home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
util
/
cdity
/
ModeProSrc.lha
/
Prefs
/
Import.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-02-07
|
735b
|
42 lines
//#define DEBUG
#include <debug.h>
#include <extras/macros/intuition.h>
#include "MPP.h"
#include "mppexterns.h"
#include <ctype.h>
#include <utility/hooks.h>
BOOL ImportFile(STRPTR FileName)
{
ULONG l;
struct List ilist[NUM_LISTS];
struct Node *n;
for(l=0;l<NUM_LISTS;l++)
NewList(&ilist[l]);
LoadFile(ilist, FileName);
ObtainSemaphore(&MPSem->NodeSem);
for(l=0;l<NUM_LISTS;l++)
{
while(n=RemHead(&ilist[l]))
{
if(!FindName(&MPSem->PromotionList[l],n->ln_Name))
{
/* don't add dupes */
AddTail(&MPSem->PromotionList[l],n);
}
else
{
FreeDNode(n);
}
}
}
FixScreenModeNames();
ReleaseSemaphore(&MPSem->NodeSem);
return(1);
}